/**
 * Copyright 2009 Dan Hansen <hansen.danr@gmail.com>
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.googlecode.php.mojo.phar;

import java.io.File;

/**
 * Build a PHAR from the current project.
 * 
 * @author <a href="hansen.danr@gmail.com">Dan Hansen</a>
 * @version $Id: PharMojo.java 79 2009-07-27 03:47:52Z hansen.danr $
 * @goal phar
 * @phase package
 * @execute phase="package"
 * @requiresDependencyResolution runtime
 */
public class PharMojo
	extends AbstractPharMojo
{

	/**
	 * Directory containing the classes.
	 * 
	 * @parameter expression="${project.build.outputDirectory}"
	 * @required
	 */
	private File classesDirectory;

	/**
	 * Classifier to add to the artifact generated. If given, the artifact will
	 * be an attachment instead.
	 * 
	 * @parameter
	 */
	private String classifier;

	/**
	 * Returns the classifier of the artifact.
	 * 
	 * @return String
	 * @see com.googlecode.php.mojo.phar.AbstractPharMojo#getClassifier()
	 */
	@Override
	protected String getClassifier()
	{
		return classifier;
	}

	/**
	 * @return type of the generated artifact
	 */
	@Override
	protected String getType()
	{
		return "phar";
	}

	/**
	 * Return the main classes directory, so it's used as the root of the jar.
	 */
	@Override
	protected File getClassesDirectory()
	{
		return classesDirectory;
	}
}
